package com.qianduo.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.qianduo.dao.ICitiesDao;
import com.qianduo.po.Cities;
import com.qianduo.util.Constants;
import com.qianduo.util.ServiceUtil;
import com.qianduo.vo.CitiesForm;

import common.util.ObjectUtil;

public class CitiesServiceImpl extends ServiceUtil{	
	private ICitiesDao citiesDao;

	public void setCitiesDao(ICitiesDao citiesDao) {
		this.citiesDao = citiesDao;
	}
	
	@SuppressWarnings("finally")
	public List<CitiesForm> getAllCities(){
		List<CitiesForm> listVO	= null;
		try{
			List<Cities> listPO	= citiesDao.getAllCities();
			if(null != listPO && listPO.size() > 0){
				listVO			= new ArrayList<CitiesForm>();
				
				for(Cities city : listPO){
					CitiesForm vo		= new CitiesForm();
					ObjectUtil.copyProperties(vo, city);
					
					listVO.add(vo);
				}
			}
		}catch(Exception e){
			Constants.log.error(className+" getAllCities",e);
		}finally{
			return listVO;
		}
	}
	
	
	@SuppressWarnings("finally")
	public boolean saveCities(CitiesForm vo){
		boolean ret		= false;
		try{
			
		}catch(Exception e){
			Constants.log.error(className+" saveCities",e);
		}finally{
			return ret;
		}
	}
}
